import http from './http'

export function getProductById(id) {
  return http.get(`/products/get/${id}`)
}

export function addProduct(data) {
  return http.post('/products/add', data)
}

export function deleteProducts(ids) {
  return http.post('/products/delete', ids)
}

export function updateProduct(data) {
  return http.put('/products/update', data)
}

export function listProducts(params) {
  // 若后端有分页查询则在 params 中传入 page/size/keyword 等
  return http.get('/products/list', { params })
}


